package cn.wolfcode.trip.base.mapper;

import cn.wolfcode.trip.base.domain.Travel;
import cn.wolfcode.trip.base.query.QueryObject;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;

public interface TravelMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Travel record);

    Travel selectByPrimaryKey(Long id);

    List<Travel> queryForList(QueryObject qo);

    int updateByPrimaryKey(Travel record);

    void changeTravelState(@Param("travelId") Long id, @Param("state") Integer state, @Param("releaseTime") Date date);

    List<Travel> queryForListForApp(QueryObject qo);

    /**
     * 查询指定作者的游记数量
     * @param authorId
     * @return
     */
    Integer count(Long authorId);

    /**
     * 查询大攻略下所有的游记
     * @param strategyId
     * @return
     */
    List<Travel> selectTravelsByStrategyId(@Param("strategyId") Long strategyId);
    List<Travel> selectTravelByids(@Param("ids") int[] ids);
}